/* Copyright (c) 2025 Beijing Semidrive Technology Corporation
 * SPDX-License-Identifier: Apache-2.0
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
/** *****************************************************************************************************
 *  \file     McuExt_PvtSens.h                                                                             *
 *  \brief    This file contains interface header for MCU MCAL driver, ...                              *
 *                                                                                                      *
 * <table>                                                                                              *
 * <tr><th>Date           <th>Version                                                                   *
 * <tr><td>2023/08/02     <td>1.0.0                                                                     *
 * </table>                                                                                             *
 *******************************************************************************************************/

#ifndef MCU_PVTSENS_H
#define MCU_PVTSENS_H


#ifdef __cplusplus
extern "C" {
#endif

/********************************************************************************************************
 *                                      Include header files                                            *
 *******************************************************************************************************/
#include "Mcal.h"
#include "McuExt_Cfg.h"

/********************************************************************************************************
 *                                 Global Macro definition                                              *
 *******************************************************************************************************/
/** \brief McuExt PVT Driver is NOT initialized. */
#define MCUEXT_PVT_UNINIT                                                     (uint8)(0x00U)

/** \brief  McuExt PVT Driver is initialized. */
#define MCUEXT_PVT_INIT                                                       (uint8)(0x01U)

/* Temperature threshold range */
#define PVT_TEMPERATURE_MIN (-75.9f) /* Mcu_Ip_PvtDoutToCelsius(0x0) */
#define PVT_TEMPERATURE_MAX (230.7f) /* Mcu_Ip_PvtDoutToCelsius(0xfff) */

#define PVT_HIGH_LOW_ALARM                                                  (1U << 0U)
#define PVT_RISING_ALARM                                                    (1U << 1U)
#define PVT_FALLING_ALARM                                                   (1U << 2U)
#define PVT_DISABLE_GOLBAL_RESET                                            (1U << 3U)


/********************************************************************************************************
 *                                 PVT Register definition                                              *
 *******************************************************************************************************/
#define PVT_CTRL_OFF  0x0U

#define FM_PVT_CTRL_POL_CNT  ((uint32)0x3U << 13U)
#define FV_PVT_CTRL_POL_CNT(v) \
  (((uint32)(v) << 13U) & FM_PVT_CTRL_POL_CNT)
#define GFV_PVT_CTRL_POL_CNT(v) \
  (((uint32)(v) & FM_PVT_CTRL_POL_CNT) >> 13U)

#define BM_PVT_CTRL_HW_POL_EN  ((uint32)0x01U << 12U)

#define BM_PVT_CTRL_RF_MODE_EN_C2_C3  ((uint32)0x01U << 11U)

#define BM_PVT_CTRL_HL_MODE_EN_C2_C3  ((uint32)0x01U << 10U)

#define BM_PVT_CTRL_RF_MODE_EN_C0_C1  ((uint32)0x01U << 9U)

#define BM_PVT_CTRL_HL_MODE_EN_C0_C1  ((uint32)0x01U << 8U)

#define BM_PVT_CTRL_LPMODE  ((uint32)0x01U << 7U)

#define FM_PVT_CTRL_CORESEL  ((uint32)0x3U << 5U)
#define FV_PVT_CTRL_CORESEL(v) \
  (((uint32)(v) << 5U) & FM_PVT_CTRL_CORESEL)
#define GFV_PVT_CTRL_CORESEL(v) \
  (((uint32)(v) & FM_PVT_CTRL_CORESEL) >> 5U)

#define BM_PVT_CTRL_PTSEL  ((uint32)0x01U << 4U)

#define BM_PVT_CTRL_PDPSEN  ((uint32)0x01U << 2U)

#define BM_PVT_CTRL_PDTSEN  ((uint32)0x01U << 1U)

#define PVT_DOUT_OFF  0x4U

#define BM_PVT_DOUT_UPD  ((uint32)0x01U << 13U)

#define FM_PVT_DOUT_DATA  ((uint32)0xfffU << 1U)
#define FV_PVT_DOUT_DATA(v) \
  (((uint32)(v) << 1U) & FM_PVT_DOUT_DATA)
#define GFV_PVT_DOUT_DATA(v) \
  (((uint32)(v) & FM_PVT_DOUT_DATA) >> 1U)

#define BM_PVT_DOUT_VALID  ((uint32)0x01U << 0U)

#define PVT_C0_HYST_H_SET_OFF  0x8U

#define FM_PVT_C0_HYST_H_SET_THRESH_L  ((uint32)0xfffU << 12U)
#define FV_PVT_C0_HYST_H_SET_THRESH_L(v) \
  (((uint32)(v) << 12U) & FM_PVT_C0_HYST_H_SET_THRESH_L)
#define GFV_PVT_C0_HYST_H_SET_THRESH_L(v) \
  (((uint32)(v) & FM_PVT_C0_HYST_H_SET_THRESH_L) >> 12U)

#define FM_PVT_C0_HYST_H_SET_THRESH_H  ((uint32)0xfffU << 0U)
#define FV_PVT_C0_HYST_H_SET_THRESH_H(v) \
  (((uint32)(v) << 0U) & FM_PVT_C0_HYST_H_SET_THRESH_H)
#define GFV_PVT_C0_HYST_H_SET_THRESH_H(v) \
  (((uint32)(v) & FM_PVT_C0_HYST_H_SET_THRESH_H) >> 0U)

#define PVT_C0_HYST_L_SET_OFF  0xcU

#define FM_PVT_C0_HYST_L_SET_THRESH_L  ((uint32)0xfffU << 12U)
#define FV_PVT_C0_HYST_L_SET_THRESH_L(v) \
  (((uint32)(v) << 12U) & FM_PVT_C0_HYST_L_SET_THRESH_L)
#define GFV_PVT_C0_HYST_L_SET_THRESH_L(v) \
  (((uint32)(v) & FM_PVT_C0_HYST_L_SET_THRESH_L) >> 12U)

#define FM_PVT_C0_HYST_L_SET_THRESH_H  ((uint32)0xfffU << 0U)
#define FV_PVT_C0_HYST_L_SET_THRESH_H(v) \
  (((uint32)(v) << 0U) & FM_PVT_C0_HYST_L_SET_THRESH_H)
#define GFV_PVT_C0_HYST_L_SET_THRESH_H(v) \
  (((uint32)(v) & FM_PVT_C0_HYST_L_SET_THRESH_H) >> 0U)

#define PVT_C0_HYST_R_SET_OFF  0x10U

#define FM_PVT_C0_HYST_R_SET_THRESH_HYST  ((uint32)0xfffU << 12U)
#define FV_PVT_C0_HYST_R_SET_THRESH_HYST(v) \
  (((uint32)(v) << 12U) & FM_PVT_C0_HYST_R_SET_THRESH_HYST)
#define GFV_PVT_C0_HYST_R_SET_THRESH_HYST(v) \
  (((uint32)(v) & FM_PVT_C0_HYST_R_SET_THRESH_HYST) >> 12U)

#define FM_PVT_C0_HYST_R_SET_THRESH_ALARM  ((uint32)0xfffU << 0U)
#define FV_PVT_C0_HYST_R_SET_THRESH_ALARM(v) \
  (((uint32)(v) << 0U) & FM_PVT_C0_HYST_R_SET_THRESH_ALARM)
#define GFV_PVT_C0_HYST_R_SET_THRESH_ALARM(v) \
  (((uint32)(v) & FM_PVT_C0_HYST_R_SET_THRESH_ALARM) >> 0U)

#define PVT_C0_HYST_F_SET_OFF  0x14U

#define FM_PVT_C0_HYST_F_SET_THRESH_HYST  ((uint32)0xfffU << 12U)
#define FV_PVT_C0_HYST_F_SET_THRESH_HYST(v) \
  (((uint32)(v) << 12U) & FM_PVT_C0_HYST_F_SET_THRESH_HYST)
#define GFV_PVT_C0_HYST_F_SET_THRESH_HYST(v) \
  (((uint32)(v) & FM_PVT_C0_HYST_F_SET_THRESH_HYST) >> 12U)

#define FM_PVT_C0_HYST_F_SET_THRESH_ALARM  ((uint32)0xfffU << 0U)
#define FV_PVT_C0_HYST_F_SET_THRESH_ALARM(v) \
  (((uint32)(v) << 0U) & FM_PVT_C0_HYST_F_SET_THRESH_ALARM)
#define GFV_PVT_C0_HYST_F_SET_THRESH_ALARM(v) \
  (((uint32)(v) & FM_PVT_C0_HYST_F_SET_THRESH_ALARM) >> 0U)

#define PVT_C0_HYST_RF_TIMER_OFF  0x18U

#define FM_PVT_C0_HYST_RF_TIMER_F_TIMER  ((uint32)0xffffU << 16U)
#define FV_PVT_C0_HYST_RF_TIMER_F_TIMER(v) \
  (((uint32)(v) << 16U) & FM_PVT_C0_HYST_RF_TIMER_F_TIMER)
#define GFV_PVT_C0_HYST_RF_TIMER_F_TIMER(v) \
  (((uint32)(v) & FM_PVT_C0_HYST_RF_TIMER_F_TIMER) >> 16U)

#define FM_PVT_C0_HYST_RF_TIMER_R_TIMER  ((uint32)0xffffU << 0U)
#define FV_PVT_C0_HYST_RF_TIMER_R_TIMER(v) \
  (((uint32)(v) << 0U) & FM_PVT_C0_HYST_RF_TIMER_R_TIMER)
#define GFV_PVT_C0_HYST_RF_TIMER_R_TIMER(v) \
  (((uint32)(v) & FM_PVT_C0_HYST_RF_TIMER_R_TIMER) >> 0U)

#define PVT_C1_HYST_H_SET_OFF  0x1cU

#define FM_PVT_C1_HYST_H_SET_THRESH_L  ((uint32)0xfffU << 12U)
#define FV_PVT_C1_HYST_H_SET_THRESH_L(v) \
  (((uint32)(v) << 12U) & FM_PVT_C1_HYST_H_SET_THRESH_L)
#define GFV_PVT_C1_HYST_H_SET_THRESH_L(v) \
  (((uint32)(v) & FM_PVT_C1_HYST_H_SET_THRESH_L) >> 12U)

#define FM_PVT_C1_HYST_H_SET_THRESH_H  ((uint32)0xfffU << 0U)
#define FV_PVT_C1_HYST_H_SET_THRESH_H(v) \
  (((uint32)(v) << 0U) & FM_PVT_C1_HYST_H_SET_THRESH_H)
#define GFV_PVT_C1_HYST_H_SET_THRESH_H(v) \
  (((uint32)(v) & FM_PVT_C1_HYST_H_SET_THRESH_H) >> 0U)

#define PVT_C1_HYST_L_SET_OFF  0x20U

#define FM_PVT_C1_HYST_L_SET_THRESH_L  ((uint32)0xfffU << 12U)
#define FV_PVT_C1_HYST_L_SET_THRESH_L(v) \
  (((uint32)(v) << 12U) & FM_PVT_C1_HYST_L_SET_THRESH_L)
#define GFV_PVT_C1_HYST_L_SET_THRESH_L(v) \
  (((uint32)(v) & FM_PVT_C1_HYST_L_SET_THRESH_L) >> 12U)

#define FM_PVT_C1_HYST_L_SET_THRESH_H  ((uint32)0xfffU << 0U)
#define FV_PVT_C1_HYST_L_SET_THRESH_H(v) \
  (((uint32)(v) << 0U) & FM_PVT_C1_HYST_L_SET_THRESH_H)
#define GFV_PVT_C1_HYST_L_SET_THRESH_H(v) \
  (((uint32)(v) & FM_PVT_C1_HYST_L_SET_THRESH_H) >> 0U)

#define PVT_C1_HYST_R_SET_OFF  0x24U

#define FM_PVT_C1_HYST_R_SET_THRESH_HYST  ((uint32)0xfffU << 12U)
#define FV_PVT_C1_HYST_R_SET_THRESH_HYST(v) \
  (((uint32)(v) << 12U) & FM_PVT_C1_HYST_R_SET_THRESH_HYST)
#define GFV_PVT_C1_HYST_R_SET_THRESH_HYST(v) \
  (((uint32)(v) & FM_PVT_C1_HYST_R_SET_THRESH_HYST) >> 12U)

#define FM_PVT_C1_HYST_R_SET_THRESH_ALARM  ((uint32)0xfffU << 0U)
#define FV_PVT_C1_HYST_R_SET_THRESH_ALARM(v) \
  (((uint32)(v) << 0U) & FM_PVT_C1_HYST_R_SET_THRESH_ALARM)
#define GFV_PVT_C1_HYST_R_SET_THRESH_ALARM(v) \
  (((uint32)(v) & FM_PVT_C1_HYST_R_SET_THRESH_ALARM) >> 0U)

#define PVT_C1_HYST_F_SET_OFF  0x28U

#define FM_PVT_C1_HYST_F_SET_THRESH_HYST  ((uint32)0xfffU << 12U)
#define FV_PVT_C1_HYST_F_SET_THRESH_HYST(v) \
  (((uint32)(v) << 12U) & FM_PVT_C1_HYST_F_SET_THRESH_HYST)
#define GFV_PVT_C1_HYST_F_SET_THRESH_HYST(v) \
  (((uint32)(v) & FM_PVT_C1_HYST_F_SET_THRESH_HYST) >> 12U)

#define FM_PVT_C1_HYST_F_SET_THRESH_ALARM  ((uint32)0xfffU << 0U)
#define FV_PVT_C1_HYST_F_SET_THRESH_ALARM(v) \
  (((uint32)(v) << 0U) & FM_PVT_C1_HYST_F_SET_THRESH_ALARM)
#define GFV_PVT_C1_HYST_F_SET_THRESH_ALARM(v) \
  (((uint32)(v) & FM_PVT_C1_HYST_F_SET_THRESH_ALARM) >> 0U)

#define PVT_C1_HYST_RF_TIMER_OFF  0x2cU

#define FM_PVT_C1_HYST_RF_TIMER_F_TIMER  ((uint32)0xffffU << 16U)
#define FV_PVT_C1_HYST_RF_TIMER_F_TIMER(v) \
  (((uint32)(v) << 16U) & FM_PVT_C1_HYST_RF_TIMER_F_TIMER)
#define GFV_PVT_C1_HYST_RF_TIMER_F_TIMER(v) \
  (((uint32)(v) & FM_PVT_C1_HYST_RF_TIMER_F_TIMER) >> 16U)

#define FM_PVT_C1_HYST_RF_TIMER_R_TIMER  ((uint32)0xffffU << 0U)
#define FV_PVT_C1_HYST_RF_TIMER_R_TIMER(v) \
  (((uint32)(v) << 0U) & FM_PVT_C1_HYST_RF_TIMER_R_TIMER)
#define GFV_PVT_C1_HYST_RF_TIMER_R_TIMER(v) \
  (((uint32)(v) & FM_PVT_C1_HYST_RF_TIMER_R_TIMER) >> 0U)

#define PVT_C0_C1_INT_EN_OFF  0x30U

#define BM_PVT_C0_C1_INT_EN_CHANNEL1_HYST_F_STA_INT_EN  ((uint32)0x01U << 7U)

#define BM_PVT_C0_C1_INT_EN_CHANNEL1_HYST_R_STA_INT_EN  ((uint32)0x01U << 6U)

#define BM_PVT_C0_C1_INT_EN_CHANNEL1_HYST_L_STA_INT_EN  ((uint32)0x01U << 5U)

#define BM_PVT_C0_C1_INT_EN_CHANNEL1_HYST_H_STA_INT_EN  ((uint32)0x01U << 4U)

#define BM_PVT_C0_C1_INT_EN_CHANNEL0_HYST_F_STA_INT_EN  ((uint32)0x01U << 3U)

#define BM_PVT_C0_C1_INT_EN_CHANNEL0_HYST_R_STA_INT_EN  ((uint32)0x01U << 2U)

#define BM_PVT_C0_C1_INT_EN_CHANNEL0_HYST_L_STA_INT_EN  ((uint32)0x01U << 1U)

#define BM_PVT_C0_C1_INT_EN_CHANNEL0_HYST_H_STA_INT_EN  ((uint32)0x01U << 0U)

#define PVT_C0_C1_STA_OFF  0x34U

#define BM_PVT_C0_C1_STA_CHANNEL1_HYST_F_STA  ((uint32)0x01U << 7U)

#define BM_PVT_C0_C1_STA_CHANNEL1_HYST_R_STA  ((uint32)0x01U << 6U)

#define BM_PVT_C0_C1_STA_CHANNEL1_HYST_L_STA  ((uint32)0x01U << 5U)

#define BM_PVT_C0_C1_STA_CHANNEL1_HYST_H_STA  ((uint32)0x01U << 4U)

#define BM_PVT_C0_C1_STA_CHANNEL0_HYST_F_STA  ((uint32)0x01U << 3U)

#define BM_PVT_C0_C1_STA_CHANNEL0_HYST_R_STA  ((uint32)0x01U << 2U)

#define BM_PVT_C0_C1_STA_CHANNEL0_HYST_L_STA  ((uint32)0x01U << 1U)

#define BM_PVT_C0_C1_STA_CHANNEL0_HYST_H_STA  ((uint32)0x01U << 0U)

#define PVT_C0_C1_STA_CLR_OFF  0x38U

#define BM_PVT_C0_C1_STA_CLR_CHANNEL1_HYST_F_STA_CLR  ((uint32)0x01U << 7U)

#define BM_PVT_C0_C1_STA_CLR_CHANNEL1_HYST_R_STA_CLR  ((uint32)0x01U << 6U)

#define BM_PVT_C0_C1_STA_CLR_CHANNEL1_HYST_L_STA_CLR  ((uint32)0x01U << 5U)

#define BM_PVT_C0_C1_STA_CLR_CHANNEL1_HYST_H_STA_CLR  ((uint32)0x01U << 4U)

#define BM_PVT_C0_C1_STA_CLR_CHANNEL0_HYST_F_STA_CLR  ((uint32)0x01U << 3U)

#define BM_PVT_C0_C1_STA_CLR_CHANNEL0_HYST_R_STA_CLR  ((uint32)0x01U << 2U)

#define BM_PVT_C0_C1_STA_CLR_CHANNEL0_HYST_L_STA_CLR  ((uint32)0x01U << 1U)

#define BM_PVT_C0_C1_STA_CLR_CHANNEL0_HYST_H_STA_CLR  ((uint32)0x01U << 0U)

#define PVT_C2_HYST_H_SET_OFF  0x3cU

#define FM_PVT_C2_HYST_H_SET_THRESH_L  ((uint32)0xfffU << 12U)
#define FV_PVT_C2_HYST_H_SET_THRESH_L(v) \
  (((uint32)(v) << 12U) & FM_PVT_C2_HYST_H_SET_THRESH_L)
#define GFV_PVT_C2_HYST_H_SET_THRESH_L(v) \
  (((uint32)(v) & FM_PVT_C2_HYST_H_SET_THRESH_L) >> 12U)

#define FM_PVT_C2_HYST_H_SET_THRESH_H  ((uint32)0xfffU << 0U)
#define FV_PVT_C2_HYST_H_SET_THRESH_H(v) \
  (((uint32)(v) << 0U) & FM_PVT_C2_HYST_H_SET_THRESH_H)
#define GFV_PVT_C2_HYST_H_SET_THRESH_H(v) \
  (((uint32)(v) & FM_PVT_C2_HYST_H_SET_THRESH_H) >> 0U)

#define PVT_C2_HYST_L_SET_OFF  0x40U

#define FM_PVT_C2_HYST_L_SET_THRESH_L  ((uint32)0xfffU << 12U)
#define FV_PVT_C2_HYST_L_SET_THRESH_L(v) \
  (((uint32)(v) << 12U) & FM_PVT_C2_HYST_L_SET_THRESH_L)
#define GFV_PVT_C2_HYST_L_SET_THRESH_L(v) \
  (((uint32)(v) & FM_PVT_C2_HYST_L_SET_THRESH_L) >> 12U)

#define FM_PVT_C2_HYST_L_SET_THRESH_H  ((uint32)0xfffU << 0U)
#define FV_PVT_C2_HYST_L_SET_THRESH_H(v) \
  (((uint32)(v) << 0U) & FM_PVT_C2_HYST_L_SET_THRESH_H)
#define GFV_PVT_C2_HYST_L_SET_THRESH_H(v) \
  (((uint32)(v) & FM_PVT_C2_HYST_L_SET_THRESH_H) >> 0U)

#define PVT_C2_HYST_R_SET_OFF  0x44U

#define FM_PVT_C2_HYST_R_SET_THRESH_HYST  ((uint32)0xfffU << 12U)
#define FV_PVT_C2_HYST_R_SET_THRESH_HYST(v) \
  (((uint32)(v) << 12U) & FM_PVT_C2_HYST_R_SET_THRESH_HYST)
#define GFV_PVT_C2_HYST_R_SET_THRESH_HYST(v) \
  (((uint32)(v) & FM_PVT_C2_HYST_R_SET_THRESH_HYST) >> 12U)

#define FM_PVT_C2_HYST_R_SET_THRESH_ALARM  ((uint32)0xfffU << 0U)
#define FV_PVT_C2_HYST_R_SET_THRESH_ALARM(v) \
  (((uint32)(v) << 0U) & FM_PVT_C2_HYST_R_SET_THRESH_ALARM)
#define GFV_PVT_C2_HYST_R_SET_THRESH_ALARM(v) \
  (((uint32)(v) & FM_PVT_C2_HYST_R_SET_THRESH_ALARM) >> 0U)

#define PVT_C2_HYST_F_SET_OFF  0x48U

#define FM_PVT_C2_HYST_F_SET_THRESH_HYST  ((uint32)0xfffU << 12U)
#define FV_PVT_C2_HYST_F_SET_THRESH_HYST(v) \
  (((uint32)(v) << 12U) & FM_PVT_C2_HYST_F_SET_THRESH_HYST)
#define GFV_PVT_C2_HYST_F_SET_THRESH_HYST(v) \
  (((uint32)(v) & FM_PVT_C2_HYST_F_SET_THRESH_HYST) >> 12U)

#define FM_PVT_C2_HYST_F_SET_THRESH_ALARM  ((uint32)0xfffU << 0U)
#define FV_PVT_C2_HYST_F_SET_THRESH_ALARM(v) \
  (((uint32)(v) << 0U) & FM_PVT_C2_HYST_F_SET_THRESH_ALARM)
#define GFV_PVT_C2_HYST_F_SET_THRESH_ALARM(v) \
  (((uint32)(v) & FM_PVT_C2_HYST_F_SET_THRESH_ALARM) >> 0U)

#define PVT_C2_HYST_RF_TIMER_OFF  0x4cU

#define FM_PVT_C2_HYST_RF_TIMER_F_TIMER  ((uint32)0xffffU << 16U)
#define FV_PVT_C2_HYST_RF_TIMER_F_TIMER(v) \
  (((uint32)(v) << 16U) & FM_PVT_C2_HYST_RF_TIMER_F_TIMER)
#define GFV_PVT_C2_HYST_RF_TIMER_F_TIMER(v) \
  (((uint32)(v) & FM_PVT_C2_HYST_RF_TIMER_F_TIMER) >> 16U)

#define FM_PVT_C2_HYST_RF_TIMER_R_TIMER  ((uint32)0xffffU << 0U)
#define FV_PVT_C2_HYST_RF_TIMER_R_TIMER(v) \
  (((uint32)(v) << 0U) & FM_PVT_C2_HYST_RF_TIMER_R_TIMER)
#define GFV_PVT_C2_HYST_RF_TIMER_R_TIMER(v) \
  (((uint32)(v) & FM_PVT_C2_HYST_RF_TIMER_R_TIMER) >> 0U)

#define PVT_C3_HYST_H_SET_OFF  0x50U

#define FM_PVT_C3_HYST_H_SET_THRESH_L  ((uint32)0xfffU << 12U)
#define FV_PVT_C3_HYST_H_SET_THRESH_L(v) \
  (((uint32)(v) << 12U) & FM_PVT_C3_HYST_H_SET_THRESH_L)
#define GFV_PVT_C3_HYST_H_SET_THRESH_L(v) \
  (((uint32)(v) & FM_PVT_C3_HYST_H_SET_THRESH_L) >> 12U)

#define FM_PVT_C3_HYST_H_SET_THRESH_H  ((uint32)0xfffU << 0U)
#define FV_PVT_C3_HYST_H_SET_THRESH_H(v) \
  (((uint32)(v) << 0U) & FM_PVT_C3_HYST_H_SET_THRESH_H)
#define GFV_PVT_C3_HYST_H_SET_THRESH_H(v) \
  (((uint32)(v) & FM_PVT_C3_HYST_H_SET_THRESH_H) >> 0U)

#define PVT_C3_HYST_L_SET_OFF  0x54U

#define FM_PVT_C3_HYST_L_SET_THRESH_L  ((uint32)0xfffU << 12U)
#define FV_PVT_C3_HYST_L_SET_THRESH_L(v) \
  (((uint32)(v) << 12U) & FM_PVT_C3_HYST_L_SET_THRESH_L)
#define GFV_PVT_C3_HYST_L_SET_THRESH_L(v) \
  (((uint32)(v) & FM_PVT_C3_HYST_L_SET_THRESH_L) >> 12U)

#define FM_PVT_C3_HYST_L_SET_THRESH_H  ((uint32)0xfffU << 0U)
#define FV_PVT_C3_HYST_L_SET_THRESH_H(v) \
  (((uint32)(v) << 0U) & FM_PVT_C3_HYST_L_SET_THRESH_H)
#define GFV_PVT_C3_HYST_L_SET_THRESH_H(v) \
  (((uint32)(v) & FM_PVT_C3_HYST_L_SET_THRESH_H) >> 0U)

#define PVT_C3_HYST_R_SET_OFF  0x58U

#define FM_PVT_C3_HYST_R_SET_THRESH_HYST  ((uint32)0xfffU << 12U)
#define FV_PVT_C3_HYST_R_SET_THRESH_HYST(v) \
  (((uint32)(v) << 12U) & FM_PVT_C3_HYST_R_SET_THRESH_HYST)
#define GFV_PVT_C3_HYST_R_SET_THRESH_HYST(v) \
  (((uint32)(v) & FM_PVT_C3_HYST_R_SET_THRESH_HYST) >> 12U)

#define FM_PVT_C3_HYST_R_SET_THRESH_ALARM  ((uint32)0xfffU << 0U)
#define FV_PVT_C3_HYST_R_SET_THRESH_ALARM(v) \
  (((uint32)(v) << 0U) & FM_PVT_C3_HYST_R_SET_THRESH_ALARM)
#define GFV_PVT_C3_HYST_R_SET_THRESH_ALARM(v) \
  (((uint32)(v) & FM_PVT_C3_HYST_R_SET_THRESH_ALARM) >> 0U)

#define PVT_C3_HYST_F_SET_OFF  0x5cU

#define FM_PVT_C3_HYST_F_SET_THRESH_HYST  ((uint32)0xfffU << 12U)
#define FV_PVT_C3_HYST_F_SET_THRESH_HYST(v) \
  (((uint32)(v) << 12U) & FM_PVT_C3_HYST_F_SET_THRESH_HYST)
#define GFV_PVT_C3_HYST_F_SET_THRESH_HYST(v) \
  (((uint32)(v) & FM_PVT_C3_HYST_F_SET_THRESH_HYST) >> 12U)

#define FM_PVT_C3_HYST_F_SET_THRESH_ALARM  ((uint32)0xfffU << 0U)
#define FV_PVT_C3_HYST_F_SET_THRESH_ALARM(v) \
  (((uint32)(v) << 0U) & FM_PVT_C3_HYST_F_SET_THRESH_ALARM)
#define GFV_PVT_C3_HYST_F_SET_THRESH_ALARM(v) \
  (((uint32)(v) & FM_PVT_C3_HYST_F_SET_THRESH_ALARM) >> 0U)

#define PVT_C3_HYST_RF_TIMER_OFF  0x60U

#define FM_PVT_C3_HYST_RF_TIMER_F_TIMER  ((uint32)0xffffU << 16U)
#define FV_PVT_C3_HYST_RF_TIMER_F_TIMER(v) \
  (((uint32)(v) << 16U) & FM_PVT_C3_HYST_RF_TIMER_F_TIMER)
#define GFV_PVT_C3_HYST_RF_TIMER_F_TIMER(v) \
  (((uint32)(v) & FM_PVT_C3_HYST_RF_TIMER_F_TIMER) >> 16U)

#define FM_PVT_C3_HYST_RF_TIMER_R_TIMER  ((uint32)0xffffU << 0U)
#define FV_PVT_C3_HYST_RF_TIMER_R_TIMER(v) \
  (((uint32)(v) << 0U) & FM_PVT_C3_HYST_RF_TIMER_R_TIMER)
#define GFV_PVT_C3_HYST_RF_TIMER_R_TIMER(v) \
  (((uint32)(v) & FM_PVT_C3_HYST_RF_TIMER_R_TIMER) >> 0U)

#define PVT_C2_C3_INT_EN_OFF  0x64U

#define BM_PVT_C2_C3_INT_EN_CHANNEL3_HYST_F_STA_INT_EN  ((uint32)0x01U << 7U)

#define BM_PVT_C2_C3_INT_EN_CHANNEL3_HYST_R_STA_INT_EN  ((uint32)0x01U << 6U)

#define BM_PVT_C2_C3_INT_EN_CHANNEL3_HYST_L_STA_INT_EN  ((uint32)0x01U << 5U)

#define BM_PVT_C2_C3_INT_EN_CHANNEL3_HYST_H_STA_INT_EN  ((uint32)0x01U << 4U)

#define BM_PVT_C2_C3_INT_EN_CHANNEL2_HYST_F_STA_INT_EN  ((uint32)0x01U << 3U)

#define BM_PVT_C2_C3_INT_EN_CHANNEL2_HYST_R_STA_INT_EN  ((uint32)0x01U << 2U)

#define BM_PVT_C2_C3_INT_EN_CHANNEL2_HYST_L_STA_INT_EN  ((uint32)0x01U << 1U)

#define BM_PVT_C2_C3_INT_EN_CHANNEL2_HYST_H_STA_INT_EN  ((uint32)0x01U << 0U)

#define PVT_C2_C3_STA_OFF  0x68U

#define BM_PVT_C2_C3_STA_CHANNEL3_HYST_F_STA  ((uint32)0x01U << 7U)

#define BM_PVT_C2_C3_STA_CHANNEL3_HYST_R_STA  ((uint32)0x01U << 6U)

#define BM_PVT_C2_C3_STA_CHANNEL3_HYST_L_STA  ((uint32)0x01U << 5U)

#define BM_PVT_C2_C3_STA_CHANNEL3_HYST_H_STA  ((uint32)0x01U << 4U)

#define BM_PVT_C2_C3_STA_CHANNEL2_HYST_F_STA  ((uint32)0x01U << 3U)

#define BM_PVT_C2_C3_STA_CHANNEL2_HYST_R_STA  ((uint32)0x01U << 2U)

#define BM_PVT_C2_C3_STA_CHANNEL2_HYST_L_STA  ((uint32)0x01U << 1U)

#define BM_PVT_C2_C3_STA_CHANNEL2_HYST_H_STA  ((uint32)0x01U << 0U)

#define PVT_C2_C3_STA_CLR_OFF  0x6cU

#define BM_PVT_C2_C3_STA_CLR_CHANNEL3_HYST_F_STA_CLR  ((uint32)0x01U << 7U)

#define BM_PVT_C2_C3_STA_CLR_CHANNEL3_HYST_R_STA_CLR  ((uint32)0x01U << 6U)

#define BM_PVT_C2_C3_STA_CLR_CHANNEL3_HYST_L_STA_CLR  ((uint32)0x01U << 5U)

#define BM_PVT_C2_C3_STA_CLR_CHANNEL3_HYST_H_STA_CLR  ((uint32)0x01U << 4U)

#define BM_PVT_C2_C3_STA_CLR_CHANNEL2_HYST_F_STA_CLR  ((uint32)0x01U << 3U)

#define BM_PVT_C2_C3_STA_CLR_CHANNEL2_HYST_R_STA_CLR  ((uint32)0x01U << 2U)

#define BM_PVT_C2_C3_STA_CLR_CHANNEL2_HYST_L_STA_CLR  ((uint32)0x01U << 1U)

#define BM_PVT_C2_C3_STA_CLR_CHANNEL2_HYST_H_STA_CLR  ((uint32)0x01U << 0U)

#define PVT_EXTRA_CFG_OFF  0x70U

#define BM_PVT_EXTRA_CFG_PVT_PMU_INT_1_EN  ((uint32)0x01U << 13U)

#define BM_PVT_EXTRA_CFG_PVT_PMU_INT_0_EN  ((uint32)0x01U << 12U)

#define FM_PVT_EXTRA_CFG_CHANNEL_TRIG_SRC_SEL  ((uint32)0xfU << 8U)
#define FV_PVT_EXTRA_CFG_CHANNEL_TRIG_SRC_SEL(v) \
  (((uint32)(v) << 8U) & FM_PVT_EXTRA_CFG_CHANNEL_TRIG_SRC_SEL)
#define GFV_PVT_EXTRA_CFG_CHANNEL_TRIG_SRC_SEL(v) \
  (((uint32)(v) & FM_PVT_EXTRA_CFG_CHANNEL_TRIG_SRC_SEL) >> 8U)

#define FM_PVT_EXTRA_CFG_RF_FSM_LOGIC_RST  ((uint32)0xfU << 4U)
#define FV_PVT_EXTRA_CFG_RF_FSM_LOGIC_RST(v) \
  (((uint32)(v) << 4U) & FM_PVT_EXTRA_CFG_RF_FSM_LOGIC_RST)
#define GFV_PVT_EXTRA_CFG_RF_FSM_LOGIC_RST(v) \
  (((uint32)(v) & FM_PVT_EXTRA_CFG_RF_FSM_LOGIC_RST) >> 4U)

#define FM_PVT_EXTRA_CFG_RF_SEQUENCE_MODE_EN  ((uint32)0xfU << 0U)
#define FV_PVT_EXTRA_CFG_RF_SEQUENCE_MODE_EN(v) \
  (((uint32)(v) << 0U) & FM_PVT_EXTRA_CFG_RF_SEQUENCE_MODE_EN)
#define GFV_PVT_EXTRA_CFG_RF_SEQUENCE_MODE_EN(v) \
  (((uint32)(v) & FM_PVT_EXTRA_CFG_RF_SEQUENCE_MODE_EN) >> 0U)

#define PVT_SEM_IRQ_CTRL_OFF  0x74U

#define BM_PVT_SEM_IRQ_CTRL_CHANNEL3_HYST_F_COR_IRQ_EN  ((uint32)0x01U << 31U)

#define BM_PVT_SEM_IRQ_CTRL_CHANNEL3_HYST_R_COR_IRQ_EN  ((uint32)0x01U << 30U)

#define BM_PVT_SEM_IRQ_CTRL_CHANNEL3_HYST_L_COR_IRQ_EN  ((uint32)0x01U << 29U)

#define BM_PVT_SEM_IRQ_CTRL_CHANNEL3_HYST_H_COR_IRQ_EN  ((uint32)0x01U << 28U)

#define BM_PVT_SEM_IRQ_CTRL_CHANNEL2_HYST_F_COR_IRQ_EN  ((uint32)0x01U << 27U)

#define BM_PVT_SEM_IRQ_CTRL_CHANNEL2_HYST_R_COR_IRQ_EN  ((uint32)0x01U << 26U)

#define BM_PVT_SEM_IRQ_CTRL_CHANNEL2_HYST_L_COR_IRQ_EN  ((uint32)0x01U << 25U)

#define BM_PVT_SEM_IRQ_CTRL_CHANNEL2_HYST_H_COR_IRQ_EN  ((uint32)0x01U << 24U)

#define BM_PVT_SEM_IRQ_CTRL_CHANNEL1_HYST_F_COR_IRQ_EN  ((uint32)0x01U << 23U)

#define BM_PVT_SEM_IRQ_CTRL_CHANNEL1_HYST_R_COR_IRQ_EN  ((uint32)0x01U << 22U)

#define BM_PVT_SEM_IRQ_CTRL_CHANNEL1_HYST_L_COR_IRQ_EN  ((uint32)0x01U << 21U)

#define BM_PVT_SEM_IRQ_CTRL_CHANNEL1_HYST_H_COR_IRQ_EN  ((uint32)0x01U << 20U)

#define BM_PVT_SEM_IRQ_CTRL_CHANNEL0_HYST_F_COR_IRQ_EN  ((uint32)0x01U << 19U)

#define BM_PVT_SEM_IRQ_CTRL_CHANNEL0_HYST_R_COR_IRQ_EN  ((uint32)0x01U << 18U)

#define BM_PVT_SEM_IRQ_CTRL_CHANNEL0_HYST_L_COR_IRQ_EN  ((uint32)0x01U << 17U)

#define BM_PVT_SEM_IRQ_CTRL_CHANNEL0_HYST_H_COR_IRQ_EN  ((uint32)0x01U << 16U)

#define BM_PVT_SEM_IRQ_CTRL_CHANNEL3_HYST_F_UNC_IRQ_EN  ((uint32)0x01U << 15U)

#define BM_PVT_SEM_IRQ_CTRL_CHANNEL3_HYST_R_UNC_IRQ_EN  ((uint32)0x01U << 14U)

#define BM_PVT_SEM_IRQ_CTRL_CHANNEL3_HYST_L_UNC_IRQ_EN  ((uint32)0x01U << 13U)

#define BM_PVT_SEM_IRQ_CTRL_CHANNEL3_HYST_H_UNC_IRQ_EN  ((uint32)0x01U << 12U)

#define BM_PVT_SEM_IRQ_CTRL_CHANNEL2_HYST_F_UNC_IRQ_EN  ((uint32)0x01U << 11U)

#define BM_PVT_SEM_IRQ_CTRL_CHANNEL2_HYST_R_UNC_IRQ_EN  ((uint32)0x01U << 10U)

#define BM_PVT_SEM_IRQ_CTRL_CHANNEL2_HYST_L_UNC_IRQ_EN  ((uint32)0x01U << 9U)

#define BM_PVT_SEM_IRQ_CTRL_CHANNEL2_HYST_H_UNC_IRQ_EN  ((uint32)0x01U << 8U)

#define BM_PVT_SEM_IRQ_CTRL_CHANNEL1_HYST_F_UNC_IRQ_EN  ((uint32)0x01U << 7U)

#define BM_PVT_SEM_IRQ_CTRL_CHANNEL1_HYST_R_UNC_IRQ_EN  ((uint32)0x01U << 6U)

#define BM_PVT_SEM_IRQ_CTRL_CHANNEL1_HYST_L_UNC_IRQ_EN  ((uint32)0x01U << 5U)

#define BM_PVT_SEM_IRQ_CTRL_CHANNEL1_HYST_H_UNC_IRQ_EN  ((uint32)0x01U << 4U)

#define BM_PVT_SEM_IRQ_CTRL_CHANNEL0_HYST_F_UNC_IRQ_EN  ((uint32)0x01U << 3U)

#define BM_PVT_SEM_IRQ_CTRL_CHANNEL0_HYST_R_UNC_IRQ_EN  ((uint32)0x01U << 2U)

#define BM_PVT_SEM_IRQ_CTRL_CHANNEL0_HYST_L_UNC_IRQ_EN  ((uint32)0x01U << 1U)

#define BM_PVT_SEM_IRQ_CTRL_CHANNEL0_HYST_H_UNC_IRQ_EN  ((uint32)0x01U << 0U)

#define PVT_DEBUG_MODE_CTRL_OFF  0x78U

#define BM_PVT_DEBUG_MODE_CTRL_FORCE_ATEST_MODE_EN  ((uint32)0x01U << 16U)

#define BM_PVT_DEBUG_MODE_CTRL_ATEST_FORCE_WORKING  ((uint32)0x01U << 15U)

#define BM_PVT_DEBUG_MODE_CTRL_ATEST_FORCE_CLK_24M  ((uint32)0x01U << 14U)

#define BM_PVT_DEBUG_MODE_CTRL_DEBUG_VALID  ((uint32)0x01U << 13U)

#define FM_PVT_DEBUG_MODE_CTRL_DEBUG_DATA  ((uint32)0xfffU << 1U)
#define FV_PVT_DEBUG_MODE_CTRL_DEBUG_DATA(v) \
  (((uint32)(v) << 1U) & FM_PVT_DEBUG_MODE_CTRL_DEBUG_DATA)
#define GFV_PVT_DEBUG_MODE_CTRL_DEBUG_DATA(v) \
  (((uint32)(v) & FM_PVT_DEBUG_MODE_CTRL_DEBUG_DATA) >> 1U)

#define BM_PVT_DEBUG_MODE_CTRL_DEBUG_DATA_SEL  ((uint32)0x01U << 0U)

#define PVT_PWM_GEN_CLK_OFF  0x7cU

#define FM_PVT_PWM_GEN_CLK_DIV_CNT  ((uint32)0xfffU << 0U)
#define FV_PVT_PWM_GEN_CLK_DIV_CNT(v) \
  (((uint32)(v) << 0U) & FM_PVT_PWM_GEN_CLK_DIV_CNT)
#define GFV_PVT_PWM_GEN_CLK_DIV_CNT(v) \
  (((uint32)(v) & FM_PVT_PWM_GEN_CLK_DIV_CNT) >> 0U)

#define PVT_PWM_CTRL_OFF  0x80U

#define BM_PVT_PWM_CTRL_PWM_ENABLE  ((uint32)0x01U << 31U)

#define BM_PVT_PWM_CTRL_PWM_DUTY_DIR  ((uint32)0x01U << 30U)

#define FM_PVT_PWM_CTRL_PWM_OVERFLOW  ((uint32)0xfffU << 12U)
#define FV_PVT_PWM_CTRL_PWM_OVERFLOW(v) \
  (((uint32)(v) << 12U) & FM_PVT_PWM_CTRL_PWM_OVERFLOW)
#define GFV_PVT_PWM_CTRL_PWM_OVERFLOW(v) \
  (((uint32)(v) & FM_PVT_PWM_CTRL_PWM_OVERFLOW) >> 12U)

#define FM_PVT_PWM_CTRL_PWM_OFFSET  ((uint32)0xfffU << 0U)
#define FV_PVT_PWM_CTRL_PWM_OFFSET(v) \
  (((uint32)(v) << 0U) & FM_PVT_PWM_CTRL_PWM_OFFSET)
#define GFV_PVT_PWM_CTRL_PWM_OFFSET(v) \
  (((uint32)(v) & FM_PVT_PWM_CTRL_PWM_OFFSET) >> 0U)

#define PVT_FUSA_ERR_STA_OFF  0x118U

#define BM_PVT_FUSA_ERR_STA_PVT_SCR_DVS_SELFTEST_UNC_ERR_STATUS  ((uint32)0x01U << 8U)

#define BM_PVT_FUSA_ERR_STA_PVT_SCR_DVS_INJ_EN_UNC_ERR_STATUS  ((uint32)0x01U << 7U)

#define BM_PVT_FUSA_ERR_STA_PVT_WDATA_UNC_ERR_STATUS  ((uint32)0x01U << 5U)

#define BM_PVT_FUSA_ERR_STA_PVT_WDATA_FATAL_STATUS  ((uint32)0x01U << 4U)

#define BM_PVT_FUSA_ERR_STA_PVT_CTL1_UNC_ERR_STATUS  ((uint32)0x01U << 3U)

#define BM_PVT_FUSA_ERR_STA_PVT_CTL0_UNC_ERR_STATUS  ((uint32)0x01U << 2U)

#define BM_PVT_FUSA_ERR_STA_PVT_ADDR_UNC_ERR_STATUS  ((uint32)0x01U << 1U)

#define BM_PVT_FUSA_ERR_STA_PVT_WDATA_COR_ERR_STATUS  ((uint32)0x01U << 0U)

#define PVT_CTRL_FUSA_INJ_OFF  0x11cU

#define FM_PVT_CTRL_FUSA_INJ_PVT_IRQ_ERR_INJ_BIT  ((uint32)0x7U << 1U)
#define FV_PVT_CTRL_FUSA_INJ_PVT_IRQ_ERR_INJ_BIT(v) \
  (((uint32)(v) << 1U) & FM_PVT_CTRL_FUSA_INJ_PVT_IRQ_ERR_INJ_BIT)
#define GFV_PVT_CTRL_FUSA_INJ_PVT_IRQ_ERR_INJ_BIT(v) \
  (((uint32)(v) & FM_PVT_CTRL_FUSA_INJ_PVT_IRQ_ERR_INJ_BIT) >> 1U)

#define BM_PVT_CTRL_FUSA_INJ_PVT_IRQ_ERR_INJ_EN  ((uint32)0x01U << 0U)

#define PVT_FUSA_STA_EN_OFF  0x124U

#define BM_PVT_FUSA_STA_EN_PVT_SCR_DVS_SELFTEST_UNC_IRQ_EN  ((uint32)0x01U << 8U)

#define BM_PVT_FUSA_STA_EN_PVT_SCR_DVS_INJ_EN_UNC_IRQ_EN  ((uint32)0x01U << 7U)

#define BM_PVT_FUSA_STA_EN_PVT_WDATA_UNC_IRQ_EN  ((uint32)0x01U << 5U)

#define BM_PVT_FUSA_STA_EN_PVT_WDATA_FATAL_EN  ((uint32)0x01U << 4U)

#define BM_PVT_FUSA_STA_EN_PVT_CTL1_UNC_IRQ_EN  ((uint32)0x01U << 3U)

#define BM_PVT_FUSA_STA_EN_PVT_CTL0_UNC_IRQ_EN  ((uint32)0x01U << 2U)

#define BM_PVT_FUSA_STA_EN_PVT_ADDR_UNC_IRQ_EN  ((uint32)0x01U << 1U)

#define BM_PVT_FUSA_STA_EN_PVT_WDATA_COR_IRQ_EN  ((uint32)0x01U << 0U)

/********************************************************************************************************
 *                                  Global Types definition                                             *
 *******************************************************************************************************/
/**
 * \brief Temperature sensor alarm modes.
 *
 * \note Do not change the order of this structure.
 */
typedef enum
{
    /**< Alarm asserted when DOUT is above HYST_H thresholds. */
    PVT_HIGH_LEVEL_ALARM = 0U,
    /**< Alarm asserted when DOUT is below HYST_L thresholds. */
    PVT_LOW_LEVEL_ALARM,
    /**< Alarm asserted when sensored value is rising above HYST_R. */
    PVT_RISING_EDGE_ALARM,
    /**< Alarm asserted when sensored value is falling below HYST_L. */
    PVT_FALLING_EDGE_ALARM,

    PVT_ALARM_NR,
} McuExt_PvtAlarmType;
/**
 * \brief PVT channel logics.
 *
 * The sensor has 2 cores, both of which have identical logics, but
 * different interrupt numbers.
 */
typedef enum
{
    PVT_CHANNEL0 = 0U,
    PVT_CHANNEL1 = 1U,
    PVT_CHANNEL_NUMBER,
} McuExt_PvtChannelIdType;

typedef void (*Mcu_PvtAlarmCbType)(McuExt_PvtChannelIdType channel,
                                   McuExt_PvtAlarmType alarm);

/**
 * \brief PVT channel logic structure.
 *
 * The controller has 2 cores, which have unique interrupt number
 * and configuration registers.
 */
typedef struct
{
    /**< Interrupt callback. */
    Mcu_PvtAlarmCbType alarmCb;
    /**< Bit mask of enabled alarms of this channel, using McuExt_PvtAlarmType
     * as bit shift. */
    uint32 alarmEnableMask;
} McuExt_PvtChannelType;

/**
 * \brief Process and temperature sensor structure.
 */
typedef struct McuExt_PvtPreType
{
    /**< PVT controller base address. */
    uint32 base;
    /**< channel logics. */
    McuExt_PvtChannelType channel[PVT_CHANNEL_NUMBER];
} McuExt_PvtType;
/**
 * \brief Level alarm configuration.
 *
 * Temperature alarm thresholds, between PVT_TEMPERATURE_MIN and
 * PVT_TEMPERATURE_MAX.
 */
typedef struct
{
    /**< Low threashold temperature. */
    float32 threshLow;
    /**< High threashold temperature. */
    float32 threshHigh;
} McuExt_PvtLevelAlarmConfigType;

/**
 * \brief Edge alarm configuration.
 *
 * Temperature alarm thresholds, between PVT_TEMPERATURE_MIN and
 * PVT_TEMPERATURE_MAX.
 */
typedef struct
{
    /**< Hysterisis temperature. In HYST_R rising edge detection mode,
     * the sensor start monitoring edge alarm status when DOUT[11:0]
     * is above hyst. In HYST_L falling edge detection mode, the
     * sensor start monitoring edge alarm status when DOUT[11:0]
     * is below hyst.
     */
    float32 hyst;

    /**< Alarm temperature. Level alarm status is asserted when
     * DOUT[11:0] is above or below alarm, depending on rising
     * or falling alarm mode.
     */
    float32 alarm;
} McuExt_PvtEdgeAlarmConfigType;

/**
 * \brief Hysterisis alarm configuration.
 */
typedef struct
{
    uint32 configOption;
    Mcu_PvtAlarmCbType pvtNotification;
    McuExt_PvtLevelAlarmConfigType levelAlarm;
    McuExt_PvtEdgeAlarmConfigType risingEdgeAlarm;
    McuExt_PvtEdgeAlarmConfigType fallingEdgeAlarm;
} McuExt_PvtAlarmConfigType;

/********************************************************************************************************
 *                                      Global variables                                                *
 *******************************************************************************************************/

extern uint8 McuExt_PvtInitializeState;
/********************************************************************************************************
 *                                  Global Function Declarations                                        *
 *******************************************************************************************************/
/** *****************************************************************************************************
 * \brief This function deinit pvt for disable all alarm in all channel.
 *
 * \verbatim
 * Syntax             : void McuExt_Ip_PvtDeinit(void)
 *
 * Service ID[hex]    : None
 *
 * Sync/Async         : Synchronous
 *
 * Reentrancy         : Non reentrant
 *
 * Parameters (in)    : devPtr - pointer to pvt device
 *
 * Parameters (inout) : None
 *
 * Parameters (out)   : None
 *
 * Return value       : errorId
 *                      E_OK for success and others for failure.
 *
 * Description        : This function deinit pvt for disable all alarm in all channel.
 *                      temperature can get.
 * \endverbatim
 *******************************************************************************************************/
void McuExt_Ip_PvtDeinit(void);

/** *****************************************************************************************************
 * \brief This function deinit pvt for disable all alarm in all channel.
 *
 * \verbatim
 * Syntax             : void McuExt_Ip_PvtEnableDisableAlarm(McuExt_PvtChannelIdType channel,
 *                                                          McuExt_PvtAlarmType alarm, boolean enable)
 *
 * Service ID[hex]    : None
 *
 * Sync/Async         : Synchronous
 *
 * Reentrancy         : Non reentrant
 *
 * Parameters (in)    : devPtr - pointer to pvt device
 *
 * Parameters (inout) : None
 *
 * Parameters (out)   : None
 *
 * Return value       : errorId
 *                      E_OK for success and others for failure.
 *
 * Description        : This function deinit pvt for disable all alarm in all channel.
 *                      temperature can get.
 * \endverbatim
 *******************************************************************************************************/
void McuExt_Ip_PvtEnableDisableAlarm(McuExt_PvtChannelIdType channel, McuExt_PvtAlarmType alarm, boolean enable);

/** *****************************************************************************************************
 * \brief This function clear alarm status according to channel and alarm type for pvt.
 *
 * \verbatim
 * Syntax             : boolean McuExt_Ip_PvtGetStatus(McuExt_PvtChannelIdType channel, McuExt_PvtAlarmType alarm)
 *
 * Service ID[hex]    : 0x36
 *
 * Sync/Async         : Synchronous
 *
 * Reentrancy         : Non reentrant
 *
 * Parameters (in)    : devPtr - pointer to pvt device
 *                      channel - channel id
 *                      alarm - alarm type
 *
 * Parameters (inout) : None
 *
 * Parameters (out)   : None
 *
 * Return value       : errorId
 *                      E_OK for success and others for failure.
 *
 * Description        : This function clear alarm status according to channel and alarm type for pvt.
 * \endverbatim
 *******************************************************************************************************/
boolean McuExt_Ip_PvtGetStatus(McuExt_PvtChannelIdType channel, McuExt_PvtAlarmType alarm);

/** *****************************************************************************************************
 * \brief This function Stop temperature sensor.
 *
 * \verbatim
 * Syntax             : void McuExt_Ip_PvtStop(void)
 *
 * Service ID[hex]    : None
 *
 * Sync/Async         : Synchronous
 *
 * Reentrancy         : Non reentrant
 *
 * Parameters (in)    : devPtr - pointer to pvt device
 *
 * Parameters (inout) : None
 *
 * Parameters (out)   : None
 *
 * Return value       : errorId
 *                      E_OK for success and others for failure.
 *
 * Description        : This function Stop temperature sensor.temperature can not get.
 * \endverbatim
 *******************************************************************************************************/
void McuExt_Ip_PvtStop(void);

/** *****************************************************************************************************
 * \brief This function get temperature value.
 *
 * \verbatim
 * Syntax             : Std_ReturnType McuExt_Ip_PvtGet(float32 *temperaturePtr)
 *
 * Service ID[hex]    : None
 *
 * Sync/Async         : Synchronous
 *
 * Reentrancy         : Non reentrant
 *
 * Parameters (in)    : devPtr - pointer to pvt device
 *
 * Parameters (inout) : temperaturePtr - pointer to pvt value
 *
 * Parameters (out)   : None
 *
 * Return value       : errorId
 *
 * Description        : This function get temperature value.
 *                      Temperature value is not ready until 280ms after Mcu_Ip_PvtStart() is called.
 * \endverbatim
 * Traceability       : SWSR_MCU_051 SW_SM001
 *******************************************************************************************************/
Std_ReturnType McuExt_Ip_PvtGet(float32 *temperaturePtr);

/** *****************************************************************************************************
 * \brief This function clear alarm status according to channel and alarm type for pvt.
 *
 * \verbatim
 * Syntax             : void McuExt_Ip_PvtClearStatus(McuExt_PvtChannelIdType channel,
                                     McuExt_PvtAlarmType alarm)
 *
 * Service ID[hex]    : 0x36
 *
 * Sync/Async         : Synchronous
 *
 * Reentrancy         : Non reentrant
 *
 * Parameters (in)    : devPtr - pointer to pvt device
 *                      channel - channel id
 *                      alarm - alarm type
 *
 * Parameters (inout) : None
 *
 * Parameters (out)   : None
 *
 * Return value       : errorId
 *                      E_OK for success and others for failure.
 *
 * Description        : This function clear alarm status according to channel and alarm type for pvt.
 * \endverbatim
 *******************************************************************************************************/
void McuExt_Ip_PvtClearStatus(McuExt_PvtChannelIdType channel,
                              McuExt_PvtAlarmType alarm);
/** *****************************************************************************************************
 * \brief This function enable temperature monitor.
 *
 * \verbatim
 * Syntax             : Std_ReturnType McuExt_Ip_PvtInit(const McuExt_PvtAlarmConfigType *configPtr)
 *
 * Service ID[hex]    : None
 *
 * Sync/Async         : Synchronous
 *
 * Reentrancy         : Non reentrant
 *
 * Parameters (in)    : None
 *
 * Parameters (inout) : None
 *
 * Parameters (out)   : None
 *
 * Return value       : errorId
 *
 * Description        : Set Temperature monitoring of PVT sensor. Configure the temperature alarm type and threshold on EB;
 *  1 Temperature highest thresholds alarm configuration:
 *            - After exceeding highest thresholds trigger a system reset.
 *  2 Temperature high alarm configuration:
 *              - After exceeding thresholds, a warning is triggered,User alarm settings can be made in the function "Mcu_Ip_PvtAlarmCb".
 *  3 Temperature rise alarm configuration:
 *              - After exceeding T1 degrees, the hardware starts the high temperature alarm monitoring,
 *              - After exceeding T2 degrees, a temperature rise warning is triggered,User alarm settings can be made in the function "Mcu_Ip_PvtAlarmCb".
 *  4 Temperature low alarm configuration:
 *              - After below thresholds, a warning is triggered,User alarm settings can be made in the function "Mcu_Ip_PvtAlarmCb".
 *  5 Temperature fall alarm configuration:<p/>
 *              - After below T1 degrees, the hardware starts the low temperature alarm monitoring,
 *              - After below T2 degrees, a temperature fall warning is triggered,User alarm settings can be made in the function "Mcu_Ip_PvtAlarmCb".
 *              Note: Choose one of the four 2)-5)
 *                    Mcu_PvtApDev is disabled by default,Configure the Mcu_PvtApDev enable on EB.
 * \endverbatim
 *******************************************************************************************************/
Std_ReturnType McuExt_Ip_PvtInit(const McuExt_PvtAlarmConfigType *configPtr);

/** *****************************************************************************************************
 * \brief Pvt irq handler.
 *
 * \verbatim
 * Syntax             : MCUEXT_LOCAL void McuExt_Ip_PvtIrqHandler(uint8 controllerId)
 *
 * Service ID[hex]    : None
 *
 * Sync/Async         : Synchronous
 *
 * Reentrancy         : Reentrant
 *
 * Parameters (in)    : controllerId - 0/1/2/3 for sf channel0/1, ap channel 0/1
 *
 * Parameters (inout) : None
 *
 * Parameters (out)   : None
 *
 * Return value       : None
 *
 * Description        : Pvt irq handler.
 * \endverbatim
 * Traceability       : SW_SM003 SW_SM004
 *******************************************************************************************************/
void McuExt_Ip_PvtIrqHandler(uint8 channel);

#ifdef __cplusplus
}
#endif

#endif /* MCU_PVTSENS_H */
/* End of file */
